Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 opennebula (5.0.0-1) unstable; urgency=low
 .
   * Imported from http://packages.qa.debian.org/o/opennebula.html
Author: OpenNebula Team <contact@opennebula.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- opennebula-5.0.0.orig/src/sunstone/public/app/utils/nics-section.js
+++ opennebula-5.0.0/src/sunstone/public/app/utils/nics-section.js
@@ -116,11 +116,14 @@ define(function(require) {
         nic["FLOATING_IP"] = "YES";
       }
 
-      delete nic["IP"];
       var ip4 = $("input.manual_ip4", $(this)).val();
 
-      if (ip4 != undefined && ip4 != ""){
-        nic["IP"] = ip4;
+      if (ip4 != undefined){
+        delete nic["IP"];
+
+        if (ip4 != ""){
+          nic["IP"] = ip4;
+        }
       }
 
       delete nic["VROUTER_MANAGEMENT"];
--- opennebula-5.0.0.orig/src/sunstone/public/app/utils/nics-section/dd.hbs
+++ opennebula-5.0.0/src/sunstone/public/app/utils/nics-section/dd.hbs
@@ -28,7 +28,11 @@
             <span class="tip">
               {{tr "Optionally, you can force the IP assigned to the network interface."}}
             </span>
-            <input type="text" class="manual_ip4" />
+            {{#if options.nic.IP}}
+            <input type="text" class="manual_ip4" value="{{options.nic.IP}}"/>
+            {{else}}
+            <input type="text" class="manual_ip4"/>
+            {{/if}}
           </label>
         </div>
       {{/if}}
